<%@ page import="java.text.SimpleDateFormat" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="<c:url value="/" />">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>${news.title}</title>

    <link href="http://wz.qichecdn.com/css/style.css" rel="stylesheet"/>
    <style>.rv-root-v2 {
        display: none;
    } </style>
    <script type="text/javascript" src="http://x.autoimg.cn/app/scripts/jquerynew.js"></script>
    <script type="text/javascript" src="http://x.autoimg.cn/app/scripts/shared.js?2015060919"></script>
    <script type="text/javascript" src="http://x.autoimg.cn/app/scripts/common.js?14051609"></script>
    <script type="text/javascript">
        function getCookieValue(objName) {//获取指定名称的cookie的值
            var arrStr = document.cookie.split("; ");
            for (var i = 0; i < arrStr.length; i++) {
                var temp = arrStr[i].split("=");
                if (temp[0] == objName) return unescape(temp[1]);
            }

        }

        var pageinfo = '{"url":"http://www2.autoimg.cn/newsdfs/g14/M10/4A/B3/400x300_0_autohomecar__wKgH5FcDgYOAbRDRAAEbSp8ixWY777.jpg","serializeorders":1,"cid":82,"event":"useCar","shareurl":"http://www.autohome.com.cn/use/201604/886661.html"}';
        var newsjson = '$newsinfo$';//软件号|平台号|版本号|大小图|白天夜间模式|字体|屏幕宽
        if (newsjson == '$newsinfo$')
            newsjson = getCookieValue('newsinfo');


        if (newsjson == undefined)
            newsjson = '{"appid": 2,"pm": 1,"version": "4.5","smallpicmodule": 0,"nightmodule": 0,"fountsize": 0,"screenwidth": 320}';//软件号|平台号|版本号|大小图|白天夜间模式|字体|屏幕宽
        else {
            newsjson = newsjson.replace("\"{", "{").replace("}\"", "}");

        }
        var newsdata = eval("(" + newsjson + ")");


    </script>
</head>
<body>
<div>
    <div class="aricle-main">
        <div class="open-app" style="display: none;">
            <div class="app-logo">
                <img src="http://x.autoimg.cn/app/image/peccancy.png">
            </div>
            <div class="app-text">
                <h3>违章查询助手</h3>
                <p>
                    最快最准 查违章
                </p>
            </div>
            <a href="#" class="app-btn">立即下载</a>
        </div>
        <h1>${news.title}</h1>
        <p class="aricle-info"><span>${news.source}</span><span>${news.author}</span><span
                class="aricle-info-date">${news.publishtime}</span></p>
        <div class="aricle-content">
            ${news.main}
        </div>
        <p style="text-align:center;font-size:12px;margin-bottom:20px;font-size:12px; color: #ccc;">
            ${news.source!="汽车之家"?"本文来自互联网，不代表违章查询助手的观点和立场":""}
        </p>
    </div>
    <div class="open-app-foot" style="display: none;">
        <div class="app-logo">
            <img src="http://x.autoimg.cn/app/image/peccancy.png">
        </div>
        <div class="app-text">
            <h3>违章查询助手</h3>
            <p>
                最快最准&nbsp;查违章
            </p>
        </div>
        <a href="#" class="app-btn">立即下载</a><span class="close iconfont" id="close-app"></span>
    </div>
    <div id="advert"></div>
</div>
</body>
<!--页面加载数据绑定-->
<script>
    $(document).ready(function () {

        //图片懒加载
        var murl = "http://x.autoimg.cn/app/image/tmbg.png";
        $("img").lazyload({
            //placeholder: murl,
            effect: "fadeIn",
            threshold: 1800,
            event: 'click'
        });
        //解决行情类文章促销时间样式
        $('h2').next('p').css('width', 'auto');
        $('a[href^=insidebrowser:http://v.autohome.com.cn]').attr('href', 'insidebrowser:http://m.autohome.com.cn/video/');
        $('iframe').css('display', 'none');

        function changeYoukuLink(o) {
            if (o) {
                $('a[href*=' + o + ']').each(
                        function (j) {
                            $(this).attr('href', $(this).attr('href').replace(o, 'http://v.youku.com/v_show/id_'));
                        }
                );
            }
        }

        changeYoukuLink('http://m.youku.com/smartphone/detail?vid=');

    });
</script>

<!--页面加载数据绑定-->
<script type="text/javascript">
    (function handleImages() {

        var imgs = document.querySelectorAll('.aricle-content img'),
                len = imgs.length,
                i = null,
                body = document.getElementsByTagName('body')[0],
                sw = newsdata.screenwidth, originalsrc;

        body.style.display = 'none';

        try {

            for (var j = 0; j < len; j++) {
                sw = newsdata.screenwidth;
                i = imgs[j];
                originalsrc = i.getAttribute('src');

                if (newsdata.smallpicmodule == 1) {
                    if (originalsrc.indexOf("/artb") > -1) {
                        originalsrc = originalsrc.replace("/artb", "/artm_artb");
                    } else if (originalsrc.indexOf("2011/6/1/") > -1) {
                        originalsrc = originalsrc.replace("2011/6/1/", "2011/6/1/artm_");
                    } else if (originalsrc.indexOf("upload/") > -1) {
                        originalsrc = originalsrc.replace("/w", "/tp");
                    } else if (originalsrc.indexOf("/w_") > -1) {
                        originalsrc = originalsrc.replace("/w_", "/t_");
                    } else {
                        originalsrc = originalsrc.replace("/620x0_0", "/320x0_0").replace("/620x0_1", "/320x0_0");
                    }
                } else {
                    if (originalsrc.indexOf("/c_") > -1) {
                        originalsrc = originalsrc.replace("/c_", "/d_");
                    } else if (originalsrc.indexOf("/300x0_") > -1) {
                        originalsrc = originalsrc.replace("/300x0_", "/620x0_");
                    } else if (originalsrc.indexOf("/t_") > -1) {
                        originalsrc = originalsrc.replace("/t_", "/w_");
                    }
                }
                i.setAttribute('data-original', originalsrc);
                sw = sw - 20;

                // 遍历图片宽高
                if (newsdata.smallpicmodule == 1) {
                    //添加上小图没有宽高的判断
                    if (i.width == 0 || i.width == '')
                        i.width = 500;
                    if (i.height == 0 || i.height == '')
                        i.width = 300;
                    i.style.height = 120 / i.width * i.height + 'px';
                    i.style.width = 120 + 'px';
                } else {
                    i.style.height = sw / i.width * i.height + 'px';
                    i.style.width = sw + 'px';
                }
            }

            //兼容第一张图片宽高
            sw = newsdata.screenwidth;
            var firstImg = imgs[0];
            if (firstImg) {
                if (firstImg.width > sw) {
                    sw = firstImg.width > sw ? sw - 20 : firstImg.width;
                    firstImg.style.height = sw / firstImg.width * firstImg.height + 'px';
                    firstImg.style.width = sw + 'px';
                }
                //兼容第一张图片大小图模式
                if (newsdata.smallpicmodule == 1) {
                    firstImg.style.height = 90 + 'px';
                    firstImg.style.width = 120 + 'px';
                }
            }

            var d = document.querySelectorAll('.picboxvideo a img');
            for (var e = 0, f = d.length; e < f; e++) {
                d[e].style.width = newsdata.screenwidth - 20 + 'px';
                d[e].style.height = 185 + "px";
            }

        } catch (e) {
        }

        body.style.display = '';
    })();

</script>
</html>